<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<script type="text/javascript">
 $(document).ready(function(){
	 $("#LevelBtn").click(function(){
		 if(pointCheck()==false)
		 {
		 return false;
		 }
		 location.href="${initParam.root}/test/jointest.do";
	 });
	 $("#LevelUpBtn").click(function(){
		 if(pointCheck()==false)
			 {
			 return false;
			 }
		location.href="${initParam.root}/test/levelUpTest.do";
		
	 });
 });
 
 function pointCheck(){
	 if(!confirm("테스트시 1000의 포인트가 감소 합니다. 테스트를 보시겠습니까?"))
		 {
		 return false;
		 }
	 var point=parseInt($("#point").val());
	
	 if(point<1000)
		 {
		 alert("포인트가 부족합니다");
		 return false;
		 }
	  
 }
 
 </script>

<h2>
<a href="${initParam.root}/member/mypageMyInfo.do">Mypage</a>
<a href="${initParam.root}/member/mypageMyGroup.do">내 그룹</a>
<a href="${initParam.root}/member/mypageMyPoint.do?id=${sessionScope.mvo.id }">내 포인트</a>
<a href="${initParam.root}/member/mypageUpdateView.do">회원정보수정</a>
<a href="${initParam.root}/member/mypageDeleteView.do">회원탈퇴</a>
</h2>
<br>
<table>
<tr><td>아이디</td> <td>${requestScope.info.id }</td></tr>
<tr><td>레벨</td> <td>${requestScope.info.level }</td><td><c:choose>
	<c:when test="${sessionScope.mvo.level == '0'}">
		<input type="button" id="LevelBtn" value="Level Test !!">
		
	</c:when>
	<c:otherwise>
		<input type="button" id="LevelUpBtn" value="Level UP Test !!">
		
	</c:otherwise>
</c:choose></td></tr>
<tr><td>포인트</td> <td>${requestScope.info.point }</td></tr>
<tr><td>닉네임</td> <td>${requestScope.info.nick }</td></tr>
<tr><td>이름</td> <td>${requestScope.info.name }</td></tr>
<tr><td>주소</td> <td>${requestScope.info.address }</td></tr>
<tr><td>전화번호</td> <td>${requestScope.info.tel }</td></tr>
<input type="hidden" id="point" value="${requestScope.info.point }">
</table>
